Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing config settings to type declarations in dist/htmx.d.ts #1936

Merged
merged 1 commit into from
Oct 31, 2023
Merged

Add missing config settings to type declarations in dist/htmx.d.ts #1936

merged 1 commit into from
Oct 31, 2023

Conversation

sjc5
Copy link
Contributor

@sjc5 sjc5 commented Oct 31, 2023

Add missing config settings to type declarations in dist/htmx.d.ts

Add missing config settings to type declarations in dist/htmx.d.ts
@sjc5
Copy link
Contributor Author

sjc5 commented Oct 31, 2023

This is a follow-up to earlier PR, closed due to my git incompetence: #1934

@alexpetros alexpetros added the ready for review Issues that are ready to be considered for merging label Oct 31, 2023
@1cg 1cg merged commit 225d8d8 into bigskysoftware:dev Oct 31, 2023
@1cg
Copy link
Contributor

1cg commented Oct 31, 2023

thank you!

@sjc5
Copy link
Contributor Author

sjc5 commented Nov 2, 2023

Shoot, I didn't realize your actual source of truth for type declarations was in the src folder (I thought you all didn't use a build step?).

This was pulled against dist, not src. Sorry about that @alexpetros, @1cg

Am I correct it should have been against this file instead?

https://github.com/bigskysoftware/htmx/blob/dev/src/htmx.d.ts

Also, slightly off topic, are you open to a PR adding the various hx attributes as a new export in the .d.ts as well?

@alexpetros
Copy link
Collaborator

Yes it should have been, that's my bad for not catching that.

Also, slightly off topic, are you open to a PR adding the various hx attributes as a new export in the .d.ts as well?

What's the point of typing HTML attributes, what does that have to do with typescript? (I'm sure there's an answer, I just don't know it)

@sjc5
Copy link
Contributor Author

sjc5 commented Nov 3, 2023

For auto complete. So when you are say here, mid-typing:

<div hx-

You can hit ctrl-space or whatever your editor's key combo for autocomplete is, and see all the possible htmx attributes. It's great if your brain is old and forgetful like me.

And some take booleans or strings -- so you'd get a type error if you pass a boolean to an attribute that is expecting a string.

@sjc5
Copy link
Contributor Author

sjc5 commented Nov 3, 2023

Someone in the discord was discussing a third-party package that exports these types, but the source of truth should really live here

Screenshot 2023-11-02 at 7 10 38 PM

@alexpetros
Copy link
Collaborator

Yup, we're more than open to PRs that update these.

alexpetros added a commit that referenced this pull request Nov 6, 2023
1cg pushed a commit that referenced this pull request Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for review Issues that are ready to be considered for merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants